<form class="form" novalidate name="roleForm" ng-if="!vm.region.show">
    <div class="modal-header">
        <h4 class="modal-title">
            <span ng-if="vm.item">角色编辑</span>
            <span ng-if="!vm.item">基本资料</span>
        </h4>
    </div>
    <div class="modal-body">
        <div class="form-group height-60">
            <label for="sysRoleName">角色名称<span class="require"></span></label>
            <input type="text" name="sysRoleName" ng-class="{error: roleForm.sysRoleName.$invalid && !roleForm.sysRoleName.$pristine}" ng-blur="vm.checkValid(roleForm.sysRoleName)" class="form-control" ng-model="vm.data.sysRoleName" id="sysRoleName" required placeholder="角色名称" />
            <span class="error" ng-show="roleForm.sysRoleName.$invalid && !roleForm.sysRoleName.$pristine">角色名称不能为空</span>
        </div>
        <div class="form-group height-60">
            <label for="sysRoleCode">角色编码<span class="require"></span></label>
            <input type="text" name="sysRoleCode" ng-class="{error: roleForm.sysRoleCode.$invalid && !roleForm.sysRoleCode.$pristine}" ng-blur="vm.checkValid(roleForm.sysRoleCode)" class="form-control" ng-model="vm.data.sysRoleCode" id="sysRoleCode" required placeholder="角色编码" />
            <span class="error" ng-show="roleForm.sysRoleCode.$invalid && !roleForm.sysRoleCode.$pristine">角色不编码能为空</span>
        </div>
        <div class="form-group height-60">
            <label for="commonRegionId">角色所属区域<span class="require"></span></label>
            <div class="cells">
                <div class="cell"> <!-- item as item.label for item in items track by item.id -->
                    <select class="form-control" name="group" ng-options="v.id as v.regionName for v in vm.select.group" ng-model="vm.group" ng-class="{error: roleForm.group.$invalid && !roleForm.group.$pristine}" ng-blur="vm.checkValid(roleForm.group)" ng-change="vm.getRegion('1100', vm.group, vm.query)" required>
                        <option value="">选择集团</option>
                    </select>
                </div>
                <div class="cell">
                    <select class="form-control" ng-disabled="!vm.select.province" ng-model="vm.province" ng-options="v.id as v.regionName for v in vm.select.province" ng-change="vm.getRegion('1300', vm.province)">
                        <option value="">选择省公司</option>
                    </select>
                </div>
                <div class="cell">
                    <select class="form-control" ng-disabled="!vm.select.city" ng-options="v.id as v.regionName for v in vm.select.city" ng-model="vm.city" ng-change="vm.getRegion('1400', vm.city)">
                        <option value="">选择市公司</option>
                    </select>
                </div>
                <div class="cell">
                    <select class="form-control" ng-disabled="!vm.select.area" ng-options="v.id as v.regionName for v in vm.select.area" ng-model="vm.area" ng-change="vm.getArea(vm.area)">
                        <option value="">选择地区</option>
                    </select>
                </div>
            </div>
            <input type="hidden" name="commonRegionId" class="form-control" ng-model="vm.data.commonRegionId" id="commonRegionId" required placeholder="角色所属区域" />
            <span class="error" ng-show="roleForm.group.$invalid && !roleForm.group.$pristine">角色所属区域不能为空</span>
        </div>
        <div class="form-group height-60">
            <label for="sysCode">归属系统<span class="require"></span></label>
            <select name="sysCode" ng-blur="vm.checkValid(roleForm.sysCode)" ng-change="vm.checkValid(roleForm.sysCode)" ng-model="vm.data.sysCode" ng-class="{error: roleForm.sysCode.$invalid && !roleForm.sysCode.$pristine}" ng-options="v.platSysNbr as v.platName for v in vm.select.plats" required id="sysCode" class="form-control">
                <option value="">请选归属系统</option>
            </select>
            <span class="error" ng-show="roleForm.sysCode.$invalid && !roleForm.sysCode.$pristine">归属系统不能为空</span>
        </div>
        <div class="form-group height-60">
            <label for="statusCd">角色状态<span class="require"></span></label>
            <select name="statusCd" ng-change="vm.checkValid(roleForm.statusCd)" ng-model="vm.data.statusCd" ng-class="{error: roleForm.statusCd.$invalid && !roleForm.statusCd.$pristine}" ng-options="k as v for (k,v) in vm.select.status" required id="statusCd" class="form-control" >
                <option value="">请选角色状态</option>
            </select>
            <span class="error" ng-show="roleForm.statusCd.$invalid && !roleForm.statusCd.$pristine">角色状态不能为空</span>
        </div>
        <div class="form-group">
            <label for="sysRoleDesc">角色描述</label>
            <textarea class="form-control" id="sysRoleDesc" ng-model="vm.data.sysRoleDesc" cols="30" rows="5" placeholder="角色描述"></textarea>
        </div>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-primary btn-xl" ng-disabled="roleForm.$invalid" ng-click="vm.save()"><span ng-if="vm.submitting"><i class="fa fa-spin fa-spinner"></i></span>保存</button>
        <button type="button" class="btn btn-default btn-xl" ng-click="vm.cancel()">取消</button>
    </div>
</form>